# 列表常用功能练习
age = [21, 25, 21, 23, 22, 20]
age.append(31)
print(age)
age.extend([29,33,30])
print(age)
print(age[0])
print(age[-1])
print(age.index(31))
#去除列表的偶数
my_list=[1,2,3,4,5,6,7,8,9,10]
new_list=list()
for x in my_list:
    if(x%2==0):
        new_list.append(x)
print("通过for循环得到的list:",new_list)
new_list.clear()
i=0
while i<len(my_list):
    if my_list[i]%2==0:
        new_list.append(my_list[i])
    i+=1
print("通过while循环得到的list:",new_list)
